package com.ehsunbehravesh.service.security.ejb.password;

/**
 *
 * @author ehsun7b
 */
public enum CharacterSet {

  ALPHABETS, CAPITAL_ALPHABETS,
  NUMBERS, SPECIAL_CHARS, NONE;

  public static CharacterSet getFromString(String code) {
    if (code.equalsIgnoreCase("alphabets")) {
      return ALPHABETS;
    } else if (code.equalsIgnoreCase("capital_alphabets")) {
      return CAPITAL_ALPHABETS;
    } else if (code.equalsIgnoreCase("numbers")) {
      return NUMBERS;
    } else if (code.equalsIgnoreCase("special_chars")) {
      return SPECIAL_CHARS;
    } else {
      return NONE;
    }
  }
}
